package com.lrs.java.j2se_self.net;
import java.io.*;
import java.net.*;

public class TestUDPServerLong {
	public static void main(String[] args){
		byte[] b = new byte[1024];
		DatagramPacket dp = new DatagramPacket(b,0,b.length);
		try{
			DatagramSocket ds = new DatagramSocket(6790);
			while(true){
				ds.receive(dp);
				ByteArrayInputStream bais = new ByteArrayInputStream(b);
				DataInputStream dis = new DataInputStream(bais);
				long l = dis.readLong();
				System.out.println(l);
			}	
		}catch(IOException e){
			e.printStackTrace();
		}
	}
}
